import {get} from "@/components/utils/request";
import {post} from "@/components/utils/request";

// 可以照着这样写请求，页面调用
//请求传递
export const homePageGetOrder = () => {
    return get("homePage/HomePageOrder/ListeningOrder");
};
//请求传递
export const getOrderById = (id) => {
    return get("homePage/HomePageOrder/getOrderById?id="+id);
};
// 定义发送请求的函数
export const upToUser = (id) => {
    return get(`homePage/HomePageOrder/upToUser?id=`+id);
};

// 接单后更新订单状态
export const updateOrderStatus = (id) => {
    return get(`homePage/HomePageOrder/updateOrderStatus?id=`+id);
};
export const getOrderCost = (orderId) => {
    return get(`homePage/HomePageOrder/getOrderCost?orderId=${orderId}`);
};
export const getOrderCosts = (orderId) => {
    return get(`homePage/HomePageOrder/getOrderCosts?orderId=${orderId}`);
};

// 结束行程后收取乘客费用
export const billsOfCharge = (billi) => {
    return post('homePage/HomePageOrder/billsOfCharge', billi);
};

// 首页获取所有司机本次运营数据
export const getOrderOneTimeItem = (driverId) => {
    return get('homePage/HomePageOrder/getOrderOneTimeItem?driverId='+driverId);
};
//  创建新的统计数据
export const createTodayOrderItem = (driverId) => {
    return get('homePage/HomePageOrder/createTodayOrderItem?driverId='+driverId);
};
// 设置司机休息
export const updateTodayOrderStatus = (id,driverId) => {
    return get('homePage/HomePageOrder/updateTodayOrderStatus?id='+id+'&driverId='+driverId);
};
// 更新统计
export const updateOrderNum = (id,driverId) => {
    return get('homePage/HomePageOrder/updateOrderNum?id='+id+'&driverId='+driverId);
};

// updateorderTime 更新接单的时间
export const updateorderTime = (orderId) => {
    return get('homePage/HomePageOrder/updateorderTime?orderId='+orderId);
};
/**updateArriveTime
 * 更新到达时间
 */
export const updateArriveTime = (orderId) => {
    return get('homePage/HomePageOrder/updateArriveTime?orderId='+orderId);
};

/**
 * 接到乘客时间
 * UpdateReceiveTime
 */
export const UpdateReceiveTime = (orderId) => {
    return get('homePage/HomePageOrder/UpdateReceiveTime?orderId='+orderId);
};
/**
 * 司机接单后更新订单状态
 * updateOrderItem
 */
export const updateOrderItem = (driverId) => {
    return get('homePage/HomePageOrder/updateOrderItem?driverId='+driverId);
};
/**
 * 司机接单后更新订单状态
 * updateOrderItem
 */
export const theDriverClicksTakeOrder = (id,driverId) => {
    return get('homePage/HomePageOrder/theDriverClicksTakeOrder?id='+id+'&driverId='+driverId);
};
/**
 * 司机接单后更新订单状态
 * theDriverArrivesAtTheStartingPoint
 */
export const theDriverArrivesAtTheStartingPoint = (orderId) => {
    return get('homePage/HomePageOrder/theDriverArrivesAtTheStartingPoint?orderId='+orderId);
};
/**
 * 司机接单后更新订单状态
 * theDriverPicksUpThePassengers
 */
export const theDriverPicksUpThePassengers = (orderId) => {
    return get('homePage/HomePageOrder/theDriverPicksUpThePassengers?orderId='+orderId);
};




